package co.laomag.coffee.api.article;

import co.laomag.coffee.model.entity.ChDiscovery;
import co.laomag.coffee.model.vo.Message;
import co.laomag.coffee.model.vo.Pagination;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author 马泽朋
 * @version 1.0
 * @date 2020/4/18 下午 7:45
 */
@Api(tags = "文章模块接口")
@RequestMapping("/articleApi")
public interface ArticleApi {

    @ApiOperation("发布发现文章")
    @ApiImplicitParam(name = "chDiscovery",value = "发现文章对象")
    @ApiResponses({
            @ApiResponse(code = 200,message = "发布成功"),
            @ApiResponse(code = 426,message = "发布失败")
    })
    @RequestMapping(value = "postDiscoveryArticle",method = RequestMethod.POST)
    Message postDiscoveryArticle(ChDiscovery chDiscovery);

    @ApiOperation("获取发现的文章并分页")
    @ApiImplicitParam(name = "pagination",value = "分页参数")
    @ApiResponses({
            @ApiResponse(code = 200,message = "查询成功")
    })
    @RequestMapping(value = "getChDiscoveryList",method = RequestMethod.GET)
    Message getChDiscoveryList(Pagination pagination);

    @ApiOperation("修改发现文章")
    @ApiImplicitParam(name = "chDiscovery",value = "发现文章对象")
    @ApiResponses({
            @ApiResponse(code = 200,message = "修改成功"),
            @ApiResponse(code = 427,message = "修改失败")
    })
    @RequestMapping(value = "updateFoundArticles",method = RequestMethod.POST)
    Message updateFoundArticles(ChDiscovery chDiscovery);

    @ApiOperation("删除发现文章")
    @ApiImplicitParam(name = "discoveryId",value = "发现文章ID")
    @ApiResponses({
            @ApiResponse(code = 200,message = "删除成功"),
            @ApiResponse(code = 428,message = "删除失败")
    })
    @RequestMapping(value = "deleteFoundArticles",method = RequestMethod.POST)
    Message deleteFoundArticles(String discoveryId);
}
